unit FormInBusy;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ExtCtrls;

type
  TInBusyForm = class(TForm)
    Image1: TImage;
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
procedure LoadAnimate;
  public
    { Public declarations }
    procedure SetText(AStr:string);
  end;

var
  InBusyForm: TInBusyForm;

implementation

{$R *.dfm}

uses Vcl.Imaging.GIFImg;

{ TInBusyForm }
procedure TInBusyForm.FormCreate(Sender: TObject);
begin
LoadAnimate;
end;

procedure TInBusyForm.LoadAnimate;
var
  gif: TGIFImage;
  stream: TResourceStream;
begin
  gif := TGIFImage.Create;
  stream := TResourceStream.Create(HINSTANCE, 'GifImage_1', RT_RCDATA);
  try
    gif.LoadFromStream(stream);
    // gif.LoadFromFile(ExtractFilePath(Application.Exename) + 'run.gif');
    gif.AnimationSpeed := 100;
    gif.Animate := True;
    Image1.Picture.Graphic := gif;
  finally
    stream.Free;
    gif.Free;
  end;

end;

procedure TInBusyForm.SetText(AStr: string);
begin
   Label1.Caption:=AStr;
end;

end.
